package com.icangya.domain;

import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "fb_user")
public class User {

    /*
    * 用户编号
    * */
    private Long id;
    /*
    * 用户微信id
    * */
    private String openId;

    private String accountNum;//用户账号

    private String referralCode;//用户推荐码
    /*
    *微信昵称
    * */
    private String nickName;
    /*
    * 用户微信头像
    * */
    private String headImgUrl;

    private Timestamp createTime;//用户注册的时间

    /*
    *上线用户id
    * */
    private Long parentId;
    /*
    *用户二维码
    * */
    private String QrCode;
    /*
    *代理用户id
    * */
    private Long proxyId;

    /**
     * 用户手机号码
     */
    private String mobilePhone;

    private String passWord;//用户登录密码

    private long sex;//性别

    private String realName;//真实姓名

    private String idCardNum;//身份证号码




    @Basic
    @Column(name = "mobile_phone")
    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    @Basic
    @Column(name = "openid")
    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }
    @Basic
    @Column(name = "account_num")
    public String getAccountNum() {
        return accountNum;
    }

    public void setAccountNum(String accountNum) {
        this.accountNum = accountNum;
    }

    @Basic
    @Column(name = "nick_name")
    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    @Basic
    @Column(name = "referral_code")
    public String getReferralCode() {
        return referralCode;
    }

    public void setReferralCode(String referralCode) {
        this.referralCode = referralCode;
    }

    @Basic
    @Column(name = "headimgurl")
    public String getHeadImgUrl() {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl) {
        this.headImgUrl = headImgUrl;
    }

    @Basic
    @Column(name = "parent_id")
    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    @Lob
    @Basic
    @Type(type = "text")
    @Column(name = "qr_code")
    public String getQrCode() {
        return QrCode;
    }

    public void setQrCode(String qrCode) {
        QrCode = qrCode;
    }

    @Basic
    @Column(name = "proxy_id")
    public Long getProxyId() {
        return proxyId;
    }

    public void setProxyId(Long proxyId) {
        this.proxyId = proxyId;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
    @Basic
    @Column(name = "password")
    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    @Basic
    @Column(name = "sex")
    public long getSex() {
        return sex;
    }

    public void setSex(long sex) {
        this.sex = sex;
    }
    @Basic
    @Column(name = "real_name")
    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }
    @Basic
    @Column(name = "idCard_num")
    public String getIdCardNum() {
        return idCardNum;
    }

    public void setIdCardNum(String idCardNum) {
        this.idCardNum = idCardNum;
    }

    public User(String openId, String nickName, String headImgUrl, Timestamp createTime, Long parentId, String qrCode, Long proxyId) {
        this.openId = openId;
        this.nickName = nickName;
        this.headImgUrl = headImgUrl;
        this.createTime = createTime;
        this.parentId = parentId;
        QrCode = qrCode;
        this.proxyId = proxyId;
    }

    public User(String openId, String nickName, String headImgUrl, Long parentId, String qrCode, Long proxyId) {
        this.openId = openId;
        this.nickName = nickName;
        this.headImgUrl = headImgUrl;
        this.parentId = parentId;
        this.QrCode = qrCode;
        this.proxyId = proxyId;
    }

    public User(String openId, String accountNum, String nickName, String headImgUrl, Timestamp createTime, Long parentId,
                String qrCode, Long proxyId, String mobilePhone) {
        this.openId = openId;
        this.accountNum = accountNum;
        this.nickName = nickName;
        this.headImgUrl = headImgUrl;
        this.createTime = createTime;
        this.parentId = parentId;
        QrCode = qrCode;
        this.proxyId = proxyId;
        this.mobilePhone = mobilePhone;
    }

    public User() {
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", openId='" + openId + '\'' +
                ", nickName='" + nickName + '\'' +
                ", headImgUrl='" + headImgUrl + '\'' +
                ", createTime=" + createTime +
                ", parentId=" + parentId +
                ", QrCode='" + QrCode + '\'' +
                ", proxyId=" + proxyId +
                '}';
    }
}
